Stop slow peers from blocking healthy traffic - #172
Merged
Conversation
myobie
force-pushed
the
fix/peer-lock-head-of-line
branch
from
September 5, 2026 06:03
2d88e4a to
dcbf4bf
Compare
myobie
force-pushed
the
fix/peer-lock-head-of-line
branch
from
September 5, 2026 06:04
dcbf4bf to
904b2e7
Compare
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The peer health loop holds one global connection-map mutex while it dials an unreachable peer. Every other peer waits for that machine.
A retained 358.498-second window measured 300 direct hetz-to-Silber probes. All passed, but 19 exceeded two seconds.
Eighteen slow probes aligned with the 20-second health loop. External p50 was 45.013 ms, p95 was 2.117 seconds, and p99 was 2.675 seconds.
The synchronized internal window recorded 18 Silber probes below 200 ms. It recorded no loss or retry, so that instrument misses the lock wait.
Change
Use one connection mutation gate per peer. Release the global map before the network dial and generation exchange.
The same-peer gate preserves connection replacement and simultaneous-open ordering. A slow peer no longer holds the map used by healthy peers.
The health loop remains sequential. That can delay later health samples, but it cannot delay application traffic after this change.
Proof
The new deterministic test pauses one peer during generation exchange. It then opens a stream through an existing connection to another peer.
The test failed on current main in 0.73 seconds. It passed after the change.
cargo test mux::tests -- --nocapture: 14 passed and one measurement ignored.cargo test --lib: 514 passed and five measurements ignored.The retained production files remain on hetz under
/tmp/fabric-latency-1788586961-*. The telemetry blindness needs a separate fix.